{% extends 'origin.html' %}

{% block content %}

    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">{{title}}</div>

            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>人员</th>
                        <th>月初积分</th>
                        <th>累积积分扣除</th>
                        <th>剩余积分</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {% for item in queryset %}
                        <tr>
                            {% if item.id == 1 %}
                                <th >{{item.person__person}}</th>
                            {% else %}
                                <th >{{item.person__person}}</th>
                            {% endif %}
                            <th>{{item.month|date:"Y-m"}}</th>
                            <th>2000</th>
                            <th>{{item.point}}</th>
                            <th id="point">{{item.sum_point}}
                            {% if item.point == 0 %}
                                <th><a href="#">查看明细</a></th>
                            {%else %}
                                <th><a href="{% url 'firstplan:point_detail' item.person item.month %}">查看明细</a></th>
                            {% endif %}
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}